<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no">
    <meta name="format-detection" content="telephone=no">
    <title></title>

    <script src="https://img.wx.xiao-bo.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>


    <link rel="stylesheet" href="https://img.wx.xiao-bo.com/ajax/libs/weui/1.1.3/style/weui.min.css"/>

</head>

<style>
    .app {
        margin: 0;
        padding: 0;
        width: 100vw;
        min-height: 100vh;
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .weui-msg_bt {
        opacity: 0.2;
        width: 100vw;
    }

    .center {
        position: absolute;
        bottom: 2vh;
        /* left: 30%; */
        width: 100vw;
        /* margin: auto; */
        text-align: center;

    }
</style>


<body>
<div class="app" id="app">
    <div class="page msg_warn js_show" tabindex="-1" style="margin-top:10%;">
        <div class="weui-msg">
            <div class="weui-msg__icon-area"><i class="weui-icon-success weui-icon_msg"></i></div>
            <div class="weui-msg__text-area ">
                <h2 class="weui-msg__title">授权成功</h2>


                <p class="site_id weui-msg__desc"></p>
                <p class="site_name weui-msg__desc"></p>

            </div>
        </div>
        <div class="weui-msg_bt">
            <div class="weui-msg__text-area center">
                <p class="site_id weui-msg__desc"></p>
                <p class="site_name weui-msg__desc"></p>
            </div>
        </div>

    </div>

</div>
<script>
    $(function ()
    {
        const decodeUTF8FromBase64 = (base64) =>
        {
            return decodeURIComponent(
                atob(base64)
                    .split('')
                    .map(function (c)
                    {
                        return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
                    })
                    .join('')
            );
        }
        if (window.location.search.length < 8) return
        var hostname = window.location.search.substr(8);
        console.log('解码内容', hostname)
        var txt = decodeUTF8FromBase64(hostname)
        var res = JSON.parse(txt)
        console.log('解码数据', res)

        $('.site_id').text(res.site.site_id)
        $('.site_name').text(res.site.site_name)

    })
</script>

</body>

</html>